import { Notify } from 'vant';
export const toChinesNum = (num: number) => {
    //数字转汉字
    const changeNum: string[] = [
        "零",
        "一",
        "二",
        "三",
        "四",
        "五",
        "六",
        "七",
        "八",
        "九",
    ];
    const unit: string[] = ["", "十", "百", "千", "万"];
    let getWan = (temp: number | string) => {
        let strArr: string[] = temp.toString().split("").reverse();
        let newNum = "";
        for (var i = 0; i < strArr.length; i++) {
            newNum =
                (i == 0 && Number(strArr[i]) == 0
                    ? ""
                    : i > 0 && Number(strArr[i]) == 0 && Number(strArr[i - 1]) == 0
                        ? ""
                        : changeNum[Number(strArr[i])] + (Number(strArr[i]) == 0 ? unit[0] : unit[i])) +
                newNum;
        }
        return newNum;
    };
    let overWan: number = Math.floor(num / 10000);
    let noWan: number | string = num % 10000;
    if (noWan.toString().length < 4) {
        noWan = "0" + noWan;
    }
    return overWan ? getWan(overWan) + "万" + getWan(noWan) : getWan(num);
}

export const loginOrUser = (isLogin: boolean) => {
    console.log(isLogin, 123456);
    Notify({ type: 'danger', message: '该功能暂未开放' });
}